package gameobject.construct;

import com.jme3.scene.Node;
import gameobject.item.Axe;
import gameobject.item.RequiredItemHolder;
import gameobject.item.Wood;
import mygame.DataStore;
import mygame.Vector3i;

public class Tree extends BaseTree implements NaturalConstruct {

    public static Tree createInstance() {
        return Tree.createInstance(DEFAULT_BASE_VOXEL_LOCATION, DEFAULT_HEIGHT);
    }

    public static Tree createInstance(Vector3i baseVoxelGridLocation) {
        return Tree.createInstance(baseVoxelGridLocation, DEFAULT_HEIGHT);
    }

    public static Tree createInstance(int height) {
        return Tree.createInstance(DEFAULT_BASE_VOXEL_LOCATION, height);
    }

    public static Tree createInstance(Vector3i baseVoxelGridLocation, int height) {
        Tree instance = new Tree();
        instance.setHeight(height);
        instance.init(baseVoxelGridLocation);
        return instance;
    }

    @Override
    protected void addModel() {
	Node model = (Node)DataStore.assetManager.loadModel("Models/Tree/Tree.mesh.j3o");
	model.scale(1.7f);
	attachChild(model);
    }

    @Override
    protected void addStartingInventory() {
	getInventory().addItem(new Wood(3));
    }
    
    @Override
    protected void addRequiredToBuild() {}

    @Override
    protected void addRequiredToHarvest() {
        requiredItemsToHarvest.get(RequiredItemHolder.CHARACTER).add(new Axe());
    }
}
